package Utils;

import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.physics.box2d.*;

public class CCamera {
	private static CCamera instance = null;
	private OrthographicCamera mCameraPlayer;
	private OrthographicCamera mCameraScreen;
	
	
	public static CCamera getInstance() {
		if(instance == null) {
			instance = new CCamera();
		}
		return instance;
	}
	
	// Init 
	public void initCamera() {
		if(mCameraPlayer == null) {
			mCameraPlayer = new OrthographicCamera();
		}
		
		if(mCameraScreen ==  null) {
			mCameraScreen = new OrthographicCamera();
		}
	}
	
	public OrthographicCamera getCameraPlayer() {
		return mCameraPlayer;
	}
	
	public OrthographicCamera getCameraScreen() {
		return mCameraScreen;
	}
	
	public void setCamera(OrthographicCamera camera , float x, float y, float viewportWidth, float viewportHeight) {
		camera.viewportHeight = viewportHeight;
		camera.viewportWidth = viewportWidth;
		camera.position.x = x;
		camera.position.y = y;
	}
	
	public void moveCamera(OrthographicCamera camera, float x, float y) {
		camera.translate(x, y);
	}
}
